爱易网页
HTML教程
使用重构的方式制作出一个水平做一个红色十字架
使用重构的方式制作出一个水平做一个红色十字架
日期:2014-05-16 浏览次数:20687 次
使用重构的方式制作出一个水平做一个红色十字架.在线等在jsp或html界面中
使用重构的方式制作出一个水平、垂直都居中短边为50px,长边为150px的红色十字架。要求:
1.使用2个div完成
2.使用3个div完成
3.使用5个div完成
大家提供点代码,在线等,thanks,------解决方案--------------------重构?
要重构成什么样子?
你们之前的这样的功能难道不是用的定位实现的吗?
直接用定位实现就可以了啊。------解决方案--------------------
#top,#middle,#left,#right,#bottom{
height:50px;
width:50px;
position:absolute;
top:100px;
left:500px;
}
#top{
margin:-75px 0 0 -25px;
background:#f00;
}
#middle{
margin:-25px 0 0 -25px;
background:#000;
}
#left{
margin:-25px 0 0 -75px;
background:#00f;
}
#right{
margin:-25px 0 0 25px;
background:#0f0;
}
#bottom{
margin:25px 0 0 -25px;
background:#ff0;
}
这样就可以了------解决方案--------------------2个div:
#out {
width: 150px; height: 50px;
background-color: red;
margin: auto;
position: absolute; left: 0; right: 0; bottom: 0; top: 0;
}
#in {
width: 50px; height: 150px;
background-color: red;
position: absolute; left: 50px; top: -50px;
}
##############################################################################
3个div:
#out {
width: 150px; height: 50px;
background-color: red;
margin: auto;
position: absolute; left: 0; right: 0; bottom: 0; top: 0;
}
#in-top {
width: 50px; height: 50px;
background-color: red;
position: absolute; left: 50px; top: -50px;
}
#in-bottom {
width: 50px; height: 50px;
background-color: red;
position: absolute; left: 50px; top: 50px;
}
##############################################################################
5个div:
&nbs
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料更多>
CSS TreeView解决思路
W3C教程(8):W3C XML Schema 活动
经过下拉框来显示对应的内容
Html缠绕数据FiledSet
47个严重的CSS3动画演示
顶表单制造方式大比拼
韩顺平_轻便搞定网页设计(html+css+javascript)_ 第18讲_js课程介绍_js基本介绍_学习笔记_源代码图解_PPT文档整理
网页开发解决方案
HTML标示_Html基础教程_HtmlCss教程
|